<?php

namespace app\index\controller;

use think\Controller;
use think\Request;

class Index extends Controller
{
    public function index()
    {
        $news_data = getNewData(2);
        
        $live_video_data = getLiveVideoData();
        $live_music_data = getLiveMusicData();
        
        $siren_data = getSirenData();
        
        $this->assign('web_news_list', $news_data['web_list']);
        $this->assign('app_news_list', $news_data['app_list']);
        $this->assign('web_all_news_count', $news_data['web_all_news_count']);
        $this->assign('app_all_news_count', $news_data['app_all_news_count']);
        $this->assign('web_today_news_count', $news_data['web_today_news_count']);
        $this->assign('app_today_news_count', $news_data['app_today_news_count']);
        $this->assign('web_error_count', $news_data['web_error_count']);
        $this->assign('app_error_count', $news_data['app_error_count']);
        $this->assign('live_video_data', $live_video_data);
        $this->assign('live_music_data', $live_music_data);
        $this->assign('siren_data', $siren_data);
        $this->assign('siren_data_json', json_encode($siren_data));
        
        return $this->view->fetch();
    }
}
